package com.hiflying.smartlink.v7;

import com.hiflying.commons.log.HFLog;
import com.hiflying.smartlink.AbstractSmartLinker;
import com.hiflying.smartlink.v3.SnifferSmartLinkerSendAction;
import com.hiflying.smartlink.v8.AirkissSendAction;

import java.util.ArrayList;

public class MulticastSmartLinker extends AbstractSmartLinker {
    public static final String META_DATA_MIX_TYPE = "com.hiflying.smartlink.v7.mix";
    public static final int MIX_TYPE_SMART_LINK_V3 = 1;
    public static final int MIX_TYPE_SMART_LINK_V8 = 2;
    private int mixType;

    /* synthetic */ MulticastSmartLinker(MulticastSmartLinker multicastSmartLinker) {
        this();
    }

    private MulticastSmartLinker() {
        this.mixType = 2;
    }

    private static final class MulticastSmartLinkerInner {
        private static final MulticastSmartLinker MULTICAST_SMART_LINKER = new MulticastSmartLinker(null);

        private MulticastSmartLinkerInner() {
        }
    }

    public static MulticastSmartLinker getInstance() {
        return MulticastSmartLinkerInner.MULTICAST_SMART_LINKER;
    }

    @Deprecated
    public void setMaxRetryTimes(int maxRetryTimes) {
    }

    /* access modifiers changed from: protected */
    @Override // com.hiflying.smartlink.AbstractSmartLinker
    public Runnable[] setupSendAction(String password, String ssid) throws Exception {
        ArrayList<Runnable> runnables = new ArrayList<>();
        runnables.add(new MulticastSmartLinkerSendAction(this.mContext, this, ssid, password, getOthers()));
        if (this.mixType == 1) {
            HFLog.d(this, "Mixed with smartlink3!");
            runnables.add(new SnifferSmartLinkerSendAction(this.mContext, this.mSmartConfigSocket, this, ssid, password, getOthers()));
        } else if (this.mixType == 2) {
            HFLog.d(this, "Mixed with airkiss!");
            runnables.add(new AirkissSendAction(this.mContext, this, ssid, password, getOthers()));
        }
        return (Runnable[]) runnables.toArray(new Runnable[runnables.size()]);
    }

    public void setMixSmartLink3(boolean enabled) {
        this.mixType = 1;
    }

    public boolean isMixSmartLink3() {
        return this.mixType == 1;
    }

    public int getMixType() {
        return this.mixType;
    }

    public void setMixType(int mixType2) {
        this.mixType = mixType2;
    }
}
